#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    vector<vector<int>> ret;
    vector<int> path;

    vector<vector<int>> findSubsequences(vector<int>& nums) {
        dfs(0, nums);
        return ret;
    }

private:
    void dfs(int i, vector<int>& nums) {
        if (i == nums.size()) {
            if (path.size() >= 2) {
                ret.push_back(path);
            }
            return;
        }

        if (path.empty() || (!path.empty() && nums[i] >= path.back())) {
            path.push_back(nums[i]);
            dfs(i + 1, nums);
            path.pop_back();
        }

        if (path.empty() || (!path.empty() && nums[i] != path.back())) {
            dfs(i + 1, nums);
        }
    }
};
int main()
{
    vector<int>nums{4, 6, 7, 7};
    Solution s;
    s.findSubsequences(nums);
    return 0;
}